import { ApiRequest, ApiProperty } from '@quick-toolkit/http';
import { Typed, TypedArray } from '@quick-toolkit/class-transformer';
import { CaptchaImageVo } from 'src/models/auth-service/captcha-image-vo.ts';

@ApiRequest({
  url: '/api/auth-service/auth/login',
  method: 'post',
  description: '用户登陆验证',
})
export class AuthSignDto {
  @ApiProperty({
    required: false,
    description: '浏览器',
    in: 'body',
    type: 'string',
  })
  @Typed(String)
  public browser?: string;

  @ApiProperty({
    required: false,
    description: '登陆设备',
    in: 'body',
    type: 'string',
  })
  @Typed(String)
  public device?: string;

  @ApiProperty({
    required: true,
    description: '账户密码',
    in: 'body',
    type: 'string',
    locales: {
      zh_CN: '密码',
      en_US: 'Password',
    },
  })
  @Typed(String)
  public password?: string;

  @ApiProperty({
    required: false,
    description: '账户',
    in: 'body',
    type: 'string',
    locales: {
      zh_CN: '账户',
      en_US: 'Account',
    },
  })
  @Typed(String)
  public username?: string;

  @ApiProperty({
    required: false,
    description: '图片验证码uuid',
    in: 'body',
    type: 'string',
  })
  @Typed(String)
  public uuid?: string;

  @ApiProperty({
    required: false,
    description: '验证码',
    in: 'body',
    type: 'string',
  })
  @Typed(String)
  public verifyCode?: string;

  @ApiProperty({
    required: false,
  })
  @TypedArray(CaptchaImageVo)
  public list?: string;
}
